package tech.aistar.corejava.day10;

import sun.java2d.loops.GeneralRenderer;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * Created by 豆梦寒 on 2019/7/27.
 */
public class CalendarDemo {
    public static void main(String[] args) {
        //通过简单工厂模式构建日历对象
        //Calendar-抽象类-永远不能被实例化的

        //面向父类编程- 父类 对象 =  new  子类()；
        // Calendar  cal = new Calendar类的子类();

        Calendar cal = Calendar.getInstance();


        System.out.println(cal);
        Calendar cal1 = new GregorianCalendar();
        System.out.println(new GregorianCalendar().isLeapYear(2014));
        System.out.println(cal1);

        Date dt = cal.getTime();
        System.out.println(dt);

    }
}
